image/manifest: accept OCI media types in Docker schema2 manifests#978
Conversation
mtrmac
left a comment
There was a problem hiding this comment.
Per #977:
Images with mixed MIME types are invalid, and have always been invalid. This code has been rejecting them since 2019, and with every passing month the case for accepting them grows weaker.
So the first recommendation must be to fix the producer, and relaxing these checks would, by now, need an exceptionally strong argument that these images are 1) widespread in the ecosystem and 2) unlikely to be fixed.
https://github.com/podman-container-tools/container-libs/blob/main/CONTRIBUTING.md#sign-your-prs please, we can’t really even look at code submissions with unclear copyright status.
|
Thanks for the clarification. We'll work with the upstream producer to standardize the generated manifests instead of relaxing the validation here. |
What
Accept OCI image config and layer media types when validating Docker schema 2 manifests in
go.podman.io/image/v5/manifest.This allows
Schema2FromManifest/SupportedSchema2MediaTypeto handle Docker schema2 manifests with OCI descriptor media types, includingapplication/vnd.oci.image.layer.v1.tar+gzip.Why
Some registries return Docker schema2 manifests whose config/layer descriptors use OCI media types. Today those fail before copy/inspection can proceed, for example through
skopeo copy --all:Fixes #977. This replaces the PR that was first opened against the migrated
containers/imagerepo: containers/image#2973.Testing
Also verified the same code path in a patched
skopeo v1.23.0build during registry mirroring: manifests with OCI layer media types copied successfully after this change.